<html>
<head>
	<title><?php echo $title ?></title>
	<link rel="stylesheet" type="text/css" href="<?php echo base_url()?>assets/grocery_crud/css/font-awesome.min.css">
	<link rel="stylesheet" type="text/css" href="<?php echo base_url()?>assets/grocery_crud/css/ui/simple/jquery-ui-1.10.1.custom.min.css">
	<script type="text/javascript" src="<?php echo base_url()?>assets/grocery_crud/js/jquery-1.10.2.min.js"></script>
	<link rel="stylesheet" type="text/css" href="<?php echo base_url()?>assets/grocery_crud/css/app.css">
	<script type="text/javascript" src="<?php echo base_url()?>assets/grocery_crud/js/jquery_plugins/ui/minified/jquery.ui.core.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url()?>assets/grocery_crud/js/jquery_plugins/ui/minified/jquery.ui.widget.min.js"></script>

	<script type="text/javascript" src="<?php echo base_url()?>assets/grocery_crud/js/jquery_plugins/ui/minified/jquery.ui.button.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url()?>assets/grocery_crud/js/jquery_plugins/ui/minified/jquery.ui.menu.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url()?>assets/grocery_crud/js/jquery_plugins/ui/minified/jquery.ui.slider.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url()?>assets/grocery_crud/js/jquery_plugins/ui/minified/jquery.ui.datepicker.min.js"></script>
	
	<style type="text/css">
		body,table td,table th{
			font-family: DroidSans;
			font-size: 12px;
		}
		.t{
			text-align: center;
		}
		#nama_field_box{
			width: 420px !important;
			margin:2px auto;
			width: 370px; 
		}
	</style>
	<?php if($mode == 'A'):?>
	<script type="text/javascript">
	$(document).ready(function(){
		$('#d1').datepicker({dateFormat: 'dd/mm/yy',changeYear:true,changeMonth:true});
		$('#d2').datepicker({dateFormat: 'dd/mm/yy',changeYear:true,changeMonth:true});


		$('#d1,#d2').change(function(){
			var dt_start = $('#d1').val();
			var dt_end = $('#d2').val();
			var jml = $('select[name=jml]').val();

			if(dt_start.length && dt_end.length ){
				$('#rsCount').text('Calculating ......').show();
				$.post('<?php echo $form_action?>?count=yes',{'d1':dt_start,'d2':dt_end,'jml':jml},function(r){
					$('#rsCount').html('<br/>Total <?php echo $ctrl=='kapal'?'Records' : ucfirst($ctrl)?> : <b>' + r + '</b> <?php echo $ctrl=='kapal' ? 'item' : ''?>.<br/><br/>');
					if(parseInt(r) > 0)
						$('#tampil,#excel').removeAttr('disabled');
					else
						$('#tampil,#excel').attr('disabled','disabled');
				});
				
			}else{
				$('#tampil').attr('disabled','disabled');

			}
		}).change();

		$('#atur').click(function(){
			$('#tampil,#excel').attr('disabled','disabled');
			$('#rsCount').hide('');
		});
	});
	</script>
	<?php endif?>
</head>

<body>
<h3 class="t"><i class="fa fa-print"></i>&nbsp;<?php echo $title?></h3>
<form action="<?php echo $form_action ?>" method="post">	
<?php if($mode == 'A'):?>
<input type="hidden" name="doPrint" value="yes">
<div align="center">
	<div style="text-align:left;width:400px" class="portlet">
	<table>
		<tbody>
			<tr><td><strong>Periode</strong></td><td> : </td>
			<td>
				<input type="text" class="calText" id="d1" size="10" value="" name="d1">s/d
				<input type="text" class="calText" id="d2" size="10" value="" name="d2">
			</td>
			</tr>
			<tr>
				<td><strong><?php echo isset($limit_caption)?$limit_caption:'Jumlah Negara'?></strong></td>
				<td> : </td>
				<td>
					<select name="jml">
						<option value="5">5</option>
						<option value="10">10</option>
						<option value="15">15</option>
						<option value="20">20</option>
						<option value="0">All</option>
					</select>
				</td>
			</tr>
			<tr>
				<td colspan="3" align="center">
					<div id="rsCount" style="color:green;display:none"></div>
				</td>
			</tr>	
			<tr>
				<td colspan="2">&nbsp;</td>
				<td>
					<input type="submit" value="Tampilkan" style="cursor:pointer" id="tampil">
					<input type="reset" style="cursor:pointer">
				</td>
			</tr>
		</tbody>
	</table>
	</div>
</div>
<?php elseif($mode == 'B'):?>

<?php endif?>
</form>
</body>
</html>